#include"iostream"
#include"contacts.pb.h"

int main()
{
    contacts::contact conn;
    conn.set_sn(10001);
    conn.set_name("丽丽");
    conn.set_score(99);
    //持久化的数据放在str，这时候可以对syr进行持久化或网络传输
    std::string str=conn.SerializeAsString();

    contacts::contact stu;
    bool ret = stu.ParseFromString(str);
    if(ret==false) return -1;

    std::cout<<stu.sn()<<std::endl;
    std::cout<<stu.name()<<std::endl;
    std::cout<<stu.score()<<std::endl;
    return 0;
}